angular.module('moti.controllers.adminscreat', ['moti.services.adminsService', 'directiveModule', 'moti.directive.modal'])
    .controller('adminsCreatCtrl', ['$scope', '$location', 'AdminsInterface', '$modal', function($scope, $location, AdminsInterface, $modal){

        //提交
        $scope.adminsCreatForm = function(){
            if($scope.admins_creat_form.$valid){
                AdminsInterface.postAdmin($scope.admin).then(function(data){
                    $modal({id : 'tip-modal', text : "添加管理员成功"}).show().autoHide();
                    $location.path('/adminsList');
                });
            }
        }
    }]);